package com.zheng.shop.rpc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.shop.common.exception.ShopException;
import com.zheng.shop.dao.mapper.ShopAttributeValueMapper;
import com.zheng.shop.dao.model.ShopAttributeKey;
import com.zheng.shop.dao.model.ShopAttributeValue;
import com.zheng.shop.rpc.api.ShopAttributeValueService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zheng.common.annotation.BaseService;
import com.zheng.common.base.BaseServiceImpl;
import com.zheng.shop.dao.mapper.ShopAttributeValueMapper;
import com.zheng.shop.dao.model.ShopAttributeValue;
import com.zheng.shop.rpc.api.ShopAttributeValueService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author likun
 * @since 2017-12-29
 */
@Service
@Transactional(rollbackFor = ShopException.class)
@BaseService
public class ShopAttributeValueServiceImpl extends BaseServiceImpl<ShopAttributeValueMapper, ShopAttributeValue> implements ShopAttributeValueService {
    private static Logger _log = LoggerFactory.getLogger(ShopAttributeValueServiceImpl.class);

    @Autowired
    private ShopAttributeValueMapper shopAttributeValueMapper;

    public List<ShopAttributeValue> getValueListByKeyId(Integer keyId) {
        EntityWrapper<ShopAttributeValue> attributeValueEntityWrapper = new EntityWrapper<>();
        attributeValueEntityWrapper.where("key_id=" + keyId);
        return selectList(attributeValueEntityWrapper);
    }
}
